/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Objects;

import java.util.Comparator;

/**
 *
 * @author William
 */
public class SquareComparator implements Comparator<Square> {

    public int compare(Square o1, Square o2) {
        double fn1 = o1.getFn();
        double fn2 = o2.getFn();
        if (fn1 > fn2) {
            return 1;
        } else if (fn1 == fn2) {
            return 0;
        } else {
            return -1;
        }
    }

}
